package IO流;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class 缓冲字符输入流 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("C:\\Users\\gdq\\OneDrive\\桌面\\File文件夹\\aaa.txt");
        BufferedReader br = new BufferedReader(fr);
        Read(br);
    }
    public static void Line(BufferedReader br) throws IOException {
        String ch;
        while ((ch = br.readLine()) != null){
            System.out.println(ch);
        }
    }
    public static void read(BufferedReader br) throws IOException {
        int a;
        while ((a = br.read()) != -1){
            System.out.print((char) a);
        }
    }
    public static void Read(BufferedReader br) throws IOException {
        int len;
        char[] chars = new char[1024];
        while ((len = br.read(chars)) != -1) {
            for (int i = 0; i < len; i++) {
                System.out.print(chars[i]);
            }
        }
    }
}
